package model.pojo;

import java.sql.ResultSet;

import models.util.MySqlDataAccessHelper;

public class OrderDetailDTO {
	private int no_OD;
	private String orderDetailID_OD;
	private String orderID_OD;
	private String productName_OD;
	private int unitID_OD;
	private String unitName_OD;
	private double number_OD=0.0;
	private double price_OD;
	private double valuation_OD;
	private double taxValue_OD;
	private double total_OD;
	private String note_OD;
	private AcTax tax;
	private int taxid;
	
	private boolean selected=false;
	private double taxOne;
		
		
	public double getTaxOne() {
		return taxOne;
	}
	public void setTaxOne(double taxOne) {
		this.taxOne = taxOne;
	}
	public boolean isSelected() {
		return selected;
	}
	public void setSelected(boolean selected) {
		this.selected = selected;
	}
//	public MySqlDataAccessHelper getMysql() {
//		return mysql;
//	}
//	public void setMysql(MySqlDataAccessHelper mysql) {
//		this.mysql = mysql;
//	}
	
	public AcTax getTax() {
		MySqlDataAccessHelper mysql = new MySqlDataAccessHelper();
		try {
			mysql.open();
			
			String sql="select * from ac_tax where TaxID="+this.taxid;
			ResultSet rs = mysql.executeQuery(sql);
			while(rs.next()){
				tax=new AcTax();
				tax.setValueTax(rs.getDouble("ValueTax"));
			}
			rs.close();
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			mysql.close();
		}
		return tax;
	}
	
	public void setTax(AcTax tax) {
		this.tax = tax;
	}
	public int getTaxid() {
		
		return taxid;
	}
	public void setTaxid(int taxid) {
		this.taxid = taxid;
	}
	public int getNo_OD() {
		return no_OD;
	}
	public void setNo_OD(int no_OD) {
		this.no_OD = no_OD;
	}
	public String getOrderDetailID_OD() {
		return orderDetailID_OD;
	}
	public void setOrderDetailID_OD(String orderDetailID_OD) {
		this.orderDetailID_OD = orderDetailID_OD;
	}
	public String getOrderID_OD() {
		return orderID_OD;
	}
	public void setOrderID_OD(String orderID_OD) {
		this.orderID_OD = orderID_OD;
	}
	public String getProductName_OD() {
		return productName_OD;
	}
	public void setProductName_OD(String productName_OD) {
		this.productName_OD = productName_OD;
	}
	public int getUnitID_OD() {
		return unitID_OD;
	}
	public void setUnitID_OD(int unitID_OD) {
		this.unitID_OD = unitID_OD;
	}
	public String getUnitName_OD() {
		return unitName_OD;
	}
	public void setUnitName_OD(String unitName_OD) {
		this.unitName_OD = unitName_OD;
	}
	public double getNumber_OD() {
		return number_OD;
	}
	public void setNumber_OD(double number_OD) {
		this.number_OD = number_OD;
	}
	public double getPrice_OD() {
		return price_OD;
	}
	public void setPrice_OD(double price_OD) {
		this.price_OD = price_OD;
	}
	public double getValuation_OD() {
		//valuation_OD=number_OD*price_OD;
		return valuation_OD;
	}
	public void setValuation_OD(double valuation_OD) {
		this.valuation_OD = valuation_OD;
	}
	public double getTaxValue_OD() {
		//taxValue_OD=number_OD*price_OD*tax;
		return taxValue_OD;
	}
	public void setTaxValue_OD(double taxValue_OD) {
		this.taxValue_OD = taxValue_OD;
	}
	public double getTotal_OD() {
		return total_OD;
	}
	public void setTotal_OD(double total_OD) {
		this.total_OD = total_OD;
	}
	public String getNote_OD() {
		return note_OD;
	}
	public void setNote_OD(String note_OD) {
		this.note_OD = note_OD;
	}
	
	public OrderDetailDTO(int no_OD, String orderDetailID_OD,
			String orderID_OD, String productName_OD, int unitID_OD,
			String unitName_OD, double number_OD, double price_OD,
			double valuation_OD, double taxValue_OD, double total_OD,
			String note_OD) {
		super();
		this.no_OD = no_OD;
		this.orderDetailID_OD = orderDetailID_OD;
		this.orderID_OD = orderID_OD;
		this.productName_OD = productName_OD;
		this.unitID_OD = unitID_OD;
		this.unitName_OD = unitName_OD;
		this.number_OD = number_OD;
		this.price_OD = price_OD;
		this.valuation_OD = valuation_OD;
		this.taxValue_OD = taxValue_OD;
		this.total_OD = total_OD;
		this.note_OD = note_OD;
	}
	
	public OrderDetailDTO() {
		
	}
	

}
